home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 47
/
Amiga Format AFCD47 (Issue 131, Xmas 1999).iso
/
-serious-
/
misc
/
fiasco_2.22
/
arexx
/
print.frx
< prev
next >
Wrap
Text File
|
1999-10-17
|
2KB
|
125 lines
/* print.frx
* Example script for printing from ARexx
* Copyright © 1995-1997 Nils Bandener
* $VER: print.frx 6.2 (22.9.97)
*/
scriptname = "Print Example"
Options Results
/*
* If not called from Fiasco, try to address the active
* Fiasco project
*/
if ~abbrev(address(), "FIASCO.") then
do
ports = show("Ports")
do i = 1 to words(ports)
if abbrev(word(ports, i), "FIASCO.") then
do
Address Value word(ports, i)
GetAttr Project Name Active ARexx
Address Value Result
break
end
end
end
fiasco_port = address()
Signal on Syntax
Signal on Halt
Signal on Break_C
Signal on Failure
LockGUI
/* This is only an example!
* In the "real world", you will have to
* use the correct field IDs
*/
GetField "Name"
Name = Result
GetField "Vorname"
Vorname = Result
GetField "Strasse"
Strasse = Result
GetField "Hausnummer"
Hausnr = Result
GetField "PLZ"
PLZ = Result
GetField "Ort"
Ort = Result
if open("f", "prt:", "write") then do
call writeln("f", Vorname || " " || Name)
call writeln("f", Strasse || " " || Hausnr)
call writeln("f", PLZ || " " || Ort)
call writeln("f", x2c(B)) /* Formfeed */
call close("f")
end
bail_out:
Address Value fiasco_port
UnlockGUI
ResetStatus
exit
syntax:
failure:
if show("Ports", fiasco_port) then
do
Address Value fiasco_port
RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
end
else
do
say "Error" rc "in line" sigl ":" errortext(rc)
say "Enter to continue"
pull dummy
end
call bail_out
halt:
break_c:
if show("Ports", fiasco_port) then
do
Address Value fiasco_port
RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
end
else
do
say "*** Break"
say "Enter to continue"
pull dummy
end
call bail_out